import request from '../utils/requset'

const api_name = '/ihs/device'

export default {
    /*
    通过id获取
    */
    getCompanyById(id) {
        return request({
            url: `${api_name}/get/${id}`,
            method: 'get'
        })
    },

    /*
    删除一个
    */
    removeById(id) {
        return request({
            url: `${api_name}/remove/${id}`,
            method: "delete"
        })
    },

    /*
    保存一个
    */
    save(company) {
        return request({
            url: `${api_name}/save`,
            method: "post",
            data: company
        })
    },

    /*
    更新一个
    */
    updateById(company) {
        return request({
            url: `${api_name}/update`,
            method: "put",
            data: company
        })
    },

    getPageList(page, limit, searchObj) {
        return request({
            url: `${api_name}/${page}/${limit}`,
            method: 'get',
            params: searchObj // url查询字符串或表单键值对
        })
    },

    //批量删除
    batchRemove(idList) {
        return request({
            url: `${api_name}/batchRemove`,
            method: 'delete',
            data: idList
        })
    },
}
